package com.janko.springbootbase.designmode.observer.v1thread;

/**
 * @Description 类文件说明
 * @Author nieyankang
 * @Version 1.0
 * @date {date} {time}
 */
public class HanFeiZi implements  IHanFeiZi{
    //韩非子是否在吃饭，作为监控的判断标准
    private volatile boolean isHaveBreakfast = false;
    //韩非子是否在娱乐
    private volatile boolean isHaveFun = false;

    @Override
    public void haveBreakfast() {
        System.out.println("韩非子:开始吃饭了...");
        this.isHaveBreakfast =true;
    }

    @Override
    public void haveFun() {
        System.out.println("韩非子:开始娱乐了...");
        this.isHaveFun = true;
    }

    public boolean isHaveBreakfast() {
        return isHaveBreakfast;
    }

    public void setHaveBreakfast(boolean haveBreakfast) {
        isHaveBreakfast = haveBreakfast;
    }

    public boolean isHaveFun() {
        return isHaveFun;
    }

    public void setHaveFun(boolean haveFun) {
        isHaveFun = haveFun;
    }
}
